import React from "react";
import { Router, Route, IndexRoute } from "react-router";

import Main from "../container/MainCtr.js";
import Index from "../container/IndexCtr.js";

class RootRoute extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        const history = this.props.history;
        const allRoutes = <Route path="/" component={ Main }>
                              <IndexRoute component={ Index } />
                              <Route key="404" path="*" component={ Index } />
                          </Route>;
        return <Router history={ history } routes={ allRoutes } />;
    }
}

export default RootRoute;